import torch
import matplotlib.pyplot as plt
x = torch.ones(2)
print(x.requires_grad) # 注意这里grad后不需要括号
x.requires_grad = True
print(x) # tensor([1., 1.], requires_grad=True)

x.gard
x.gard_fn.pr
z = 4 * x
print(z)
y = z.norm()
print(y)
y.backward()

